<div class="row">
    	<div class="col-xs-12">

    		<div class="ui-portlet">
				<ol class="breadcrumb">
				  <li><a href="/users/index"><i class="fa fa-home"></i>&nbsp;&nbsp;个人中心</a></li>
				  <li><a href="/bots/mine">我的机器人</a></li>
				  <li class="active">{{$Bot['Bot']['name']}}</li>
				</ol>
			</div>

      		
			<hr>
		</div>

{{$this->Form->create('Bot',array('url'=>array('action'=>'sendGroupMsg'),'id'=>'BotViewForm','class'=>'form-horizontal','role'=>'form'))}}
		<div class="col-md-12">
			<p>
				<label><input type="checkbox" onclick="checkAll(this,'#BotViewForm');"> 全选</label>
			</p>
			<?php $last_role = 0; ?>
			{{loop $datalist $item}}
				{{if $last_role == 0 && $item['BotGroupMember']['role']==2 }}
				<h2>我的微信群</h2>
				{{/if}}

				{{if in_array($last_role,array(0,2)) && $item['BotGroupMember']['role']==1 }}
				<h2>授权我的群</h2>
				{{/if}}

				<div style="display:inline-block;width:48%;margin:0 1% 5px 0;padding:10px;border:1px solid #eee;"><label><input type="checkbox" name="group[]" value="{{$item['BotGroup']['id']}}">{{$item['BotGroup']['name']}} </label>
					{{if $item['BotGroupMember']['role']==2}}
					<p><small>
						<a target="_blank" href="/bot_groups/invite/{{$item['BotGroup']['id']}}">邀请加入群分享</a>
					</small></p>
					{{/if}}
				</div>
				<?php $last_role = $item['BotGroupMember']['role']; ?>
			{{/loop}}
		</div>
		<div class="col-md-12">
			
				<div class="form-group">
					<label class="col-sm-2 control-label" for="BotMessageMessage">群发消息</label>
					<div class="col-sm-9 controls">
						<textarea name="content" class="form-control valid" rows="3" cols="30" aria-invalid="false"></textarea>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"></label>
					<div class="col-sm-9"><input onclick="return confirm('是否确认群发消息内容');" class="btn btn-primary" type="submit" value="提交"></div>
				</div>
				<hr>

				
		</div>
{{$this->Form->end()}}
</div>
